package cn.wbu.zyh.mapper;

import cn.wbu.zyh.annotation.AutoFill;
import cn.wbu.zyh.entity.Employee;
import cn.wbu.zyh.entity.Invitation;
import cn.wbu.zyh.enumeration.OperationType;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface InvitationMapper {
    @Insert("INSERT INTO invitations(team_id,teamName, inviterId, inviteeId, created_time, updated_time, status) " +
            "VALUES (#{teamId},#{teamName}, #{inviterId}, #{inviteeId}, #{createdTime}, #{updatedTime}, #{status})")
    @AutoFill(value = OperationType.INSERT)
    void insert(Invitation invitation);

    List<Invitation> findPendingInvites(String username);
    List<Invitation> findInviteHistory(String username);

    void updateInvitation(Invitation invitation);

    Invitation findInvitationByUsername(String username);
}
